package Collection;

import java.util.ArrayList;

public class CollectionDemo4 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("a");
        list.add("b");
        list.add("c");
        list.add("d");
        list.add("e");
        //修改第三方变量是不会影响到集合里面的元素
        for (String s : list) {
            s="q";
            System.out.println(s);
        }
        System.out.println(list);
    }
}
